<?PHP
  class FormListWidget extends WidgetBase{
    public function load(){
      $this->headline = "Formulare";

      $template = new Template();
      $template->load("plugin_formlistwidget_formlist");
      $forms = Form::getByDir($_GET['dir']);
      if($forms){
        foreach($forms as $form){
          $index = $template->add_loop_item("FORMS");
          $template->assign_loop_var("FORMS",$index,"NAME",$form->name);
          $template->assign_loop_var("FORMS",$index,"EDITURL",Settings::getInstance()->get("host")."admin/formedit.html?form=".$form->id);
        }
        $template->assign_var("NOFORMS","");
      }
      else{
       $template->assign_var("NOFORMS","Es sind keine Formulare vorhanden.");
      }
      $this->content = $template->getCode();
    }
  }
?>